/*******************************************************************************
 * Copyright (c) 2006 CEA List.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     CEA List - initial API and implementation
 *******************************************************************************/
package com.cea.papyrus.diagram.statemachine.preference;

import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.RGB;

import com.cea.papyrus.core.preference.PreferenceConstants;

/**
 * Defines Constants for state machine diagram preferences.
 * 
 * @author Gilles Cannenterre
 * @since 6 dec. 06
 */
public class StateMachineDiagramPreferenceConstants {
	
	// ConnectionPointReference
	/**
	 * The Constant P_CONNECTIONPOINTREFERENCE_BACKGROUNDCOLOR.
	 */
	public static final String P_CONNECTIONPOINTREFERENCE_BACKGROUNDCOLOR = "StateMachineDiagramPreferenceConstants.ConnectionPointReference.backGroundColor";
	
	/**
	 * The Constant P_CONNECTIONPOINTREFERENCE_BORDERCOLOR.
	 */
	public static final String P_CONNECTIONPOINTREFERENCE_BORDERCOLOR = "StateMachineDiagramPreferenceConstants.ConnectionPointReference.borderColor";
	
	/**
	 * The Constant P_CONNECTIONPOINTREFERENCE_FONTCOLOR.
	 */
	public static final String P_CONNECTIONPOINTREFERENCE_FONTCOLOR = "StateMachineDiagramPreferenceConstants.ConnectionPointReference.fontColor";
	
	/**
	 * The Constant P_CONNECTIONPOINTREFERENCE_FONT.
	 */
	public static final String P_CONNECTIONPOINTREFERENCE_FONT = "StateMachineDiagramPreferenceConstants.ConnectionPointReference.font";

	// FinalState
	/**
	 * The Constant P_FINALSTATE_BACKGROUNDCOLOR.
	 */
	public static final String P_FINALSTATE_BACKGROUNDCOLOR = "StateMachineDiagramPreferenceConstants.FinalState.backGroundColor";
	
	/**
	 * The Constant P_FINALSTATE_BORDERCOLOR.
	 */
	public static final String P_FINALSTATE_BORDERCOLOR = "StateMachineDiagramPreferenceConstants.FinalState.borderColor";
	
	/**
	 * The Constant P_FINALSTATE_FONTCOLOR.
	 */
	public static final String P_FINALSTATE_FONTCOLOR = "StateMachineDiagramPreferenceConstants.FinalState.fontColor";
	
	/**
	 * The Constant P_FINALSTATE_FONT.
	 */
	public static final String P_FINALSTATE_FONT = "StateMachineDiagramPreferenceConstants.FinalState.font";

	// PseudoState
	/**
	 * The Constant P_PSEUDOSTATE_BACKGROUNDCOLOR.
	 */
	public static final String P_PSEUDOSTATE_BACKGROUNDCOLOR = "StateMachineDiagramPreferenceConstants.PseudoState.backGroundColor";
	
	/**
	 * The Constant P_PSEUDOSTATE_BORDERCOLOR.
	 */
	public static final String P_PSEUDOSTATE_BORDERCOLOR = "StateMachineDiagramPreferenceConstants.PseudoState.borderColor";
	
	/**
	 * The Constant P_PSEUDOSTATE_FONTCOLOR.
	 */
	public static final String P_PSEUDOSTATE_FONTCOLOR = "StateMachineDiagramPreferenceConstants.PseudoState.fontColor";
	
	/**
	 * The Constant P_PSEUDOSTATE_FONT.
	 */
	public static final String P_PSEUDOSTATE_FONT = "StateMachineDiagramPreferenceConstants.PseudoState.font";
	
	// Region
	/**
	 * The Constant P_REGION_BACKGROUNDCOLOR.
	 */
	public static final String P_REGION_BACKGROUNDCOLOR = "StateMachineDiagramPreferenceConstants.Region.backGroundColor";
	
	/**
	 * The Constant P_REGION_BORDERCOLOR.
	 */
	public static final String P_REGION_BORDERCOLOR = "StateMachineDiagramPreferenceConstants.Region.borderColor";
	
	/**
	 * The Constant P_REGION_FONTCOLOR.
	 */
	public static final String P_REGION_FONTCOLOR = "StateMachineDiagramPreferenceConstants.Region.fontColor";
	
	/**
	 * The Constant P_REGION_FONT.
	 */
	public static final String P_REGION_FONT = "StateMachineDiagramPreferenceConstants.Region.font";
	
	// StateMachine
	/**
	 * The Constant P_STATEMACHINE_BACKGROUNDCOLOR.
	 */
	public static final String P_STATEMACHINE_BACKGROUNDCOLOR = "StateMachineDiagramPreferenceConstants.StateMachine.backGroundColor";
	
	/**
	 * The Constant P_STATEMACHINE_BORDERCOLOR.
	 */
	public static final String P_STATEMACHINE_BORDERCOLOR = "StateMachineDiagramPreferenceConstants.StateMachine.borderColor";
	
	/**
	 * The Constant P_STATEMACHINE_FONTCOLOR.
	 */
	public static final String P_STATEMACHINE_FONTCOLOR = "StateMachineDiagramPreferenceConstants.StateMachine.fontColor";
	
	/**
	 * The Constant P_STATEMACHINE_FONT.
	 */
	public static final String P_STATEMACHINE_FONT = "StateMachineDiagramPreferenceConstants.StateMachine.font";
	
	// State
	/**
	 * The Constant P_STATE_BACKGROUNDCOLOR.
	 */
	public static final String P_STATE_BACKGROUNDCOLOR = "StateMachineDiagramPreferenceConstants.State.backGroundColor";
	
	/**
	 * The Constant P_STATE_BORDERCOLOR.
	 */
	public static final String P_STATE_BORDERCOLOR = "StateMachineDiagramPreferenceConstants.State.borderColor";
	
	/**
	 * The Constant P_STATE_FONTCOLOR.
	 */
	public static final String P_STATE_FONTCOLOR = "StateMachineDiagramPreferenceConstants.State.fontColor";
	
	/**
	 * The Constant P_STATE_FONT.
	 */
	public static final String P_STATE_FONT = "StateMachineDiagramPreferenceConstants.State.font";
	
	/**
	 * Gets the preference connection point reference background color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference connection point reference background color
	 */
	public static RGB getPreferenceConnectionPointReferenceBackgroundColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_CONNECTIONPOINTREFERENCE_BACKGROUNDCOLOR);
	}
	
	/**
	 * Gets the preference connection point reference border color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference connection point reference border color
	 */
	public static RGB getPreferenceConnectionPointReferenceBorderColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_CONNECTIONPOINTREFERENCE_BORDERCOLOR);
	}
	
	/**
	 * Gets the preference connection point reference font color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference connection point reference font color
	 */
	public static RGB getPreferenceConnectionPointReferenceFontColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_CONNECTIONPOINTREFERENCE_FONTCOLOR);
	}

	/**
	 * Gets the preference connection point reference font.
	 * 
	 * @param store the store
	 * 
	 * @return the preference connection point reference font
	 */
	public static FontData[] getPreferenceConnectionPointReferenceFont(IPreferenceStore store) {
		return PreferenceConverter.getFontDataArray(store, P_CONNECTIONPOINTREFERENCE_FONT);
	}
	
	/**
	 * Gets the preference final state background color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference final state background color
	 */
	public static RGB getPreferenceFinalStateBackgroundColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_FINALSTATE_BACKGROUNDCOLOR);
	}
	
	/**
	 * Gets the preference final state border color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference final state border color
	 */
	public static RGB getPreferenceFinalStateBorderColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_FINALSTATE_BORDERCOLOR);
	}
	
	/**
	 * Gets the preference final state font color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference final state font color
	 */
	public static RGB getPreferenceFinalStateFontColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_FINALSTATE_FONTCOLOR);
	}

	/**
	 * Gets the preference final state font.
	 * 
	 * @param store the store
	 * 
	 * @return the preference final state font
	 */
	public static FontData[] getPreferenceFinalStateFont(IPreferenceStore store) {
		return PreferenceConverter.getFontDataArray(store, P_FINALSTATE_FONT);
	}
	
	/**
	 * Gets the preference pseudo state background color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference pseudo state background color
	 */
	public static RGB getPreferencePseudoStateBackgroundColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_PSEUDOSTATE_BACKGROUNDCOLOR);
	}
	
	/**
	 * Gets the preference pseudo state border color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference pseudo state border color
	 */
	public static RGB getPreferencePseudoStateBorderColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_PSEUDOSTATE_BORDERCOLOR);
	}
	
	/**
	 * Gets the preference pseudo state font color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference pseudo state font color
	 */
	public static RGB getPreferencePseudoStateFontColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_PSEUDOSTATE_FONTCOLOR);
	}

	/**
	 * Gets the preference pseudo state font.
	 * 
	 * @param store the store
	 * 
	 * @return the preference pseudo state font
	 */
	public static FontData[] getPreferencePseudoStateFont(IPreferenceStore store) {
		return PreferenceConverter.getFontDataArray(store, P_PSEUDOSTATE_FONT);
	}
	
	/**
	 * Gets the preference region background color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference region background color
	 */
	public static RGB getPreferenceRegionBackgroundColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_REGION_BACKGROUNDCOLOR);
	}
	
	/**
	 * Gets the preference region border color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference region border color
	 */
	public static RGB getPreferenceRegionBorderColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_REGION_BORDERCOLOR);
	}
	
	/**
	 * Gets the preference region font color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference region font color
	 */
	public static RGB getPreferenceRegionFontColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_REGION_FONTCOLOR);
	}

	/**
	 * Gets the preference region font.
	 * 
	 * @param store the store
	 * 
	 * @return the preference region font
	 */
	public static FontData[] getPreferenceRegionFont(IPreferenceStore store) {
		return PreferenceConverter.getFontDataArray(store, P_REGION_FONT);
	}
	
	/**
	 * Gets the preference state machine background color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference state machine background color
	 */
	public static RGB getPreferenceStateMachineBackgroundColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_STATEMACHINE_BACKGROUNDCOLOR);
	}
	
	/**
	 * Gets the preference state machine border color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference state machine border color
	 */
	public static RGB getPreferenceStateMachineBorderColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_STATEMACHINE_BORDERCOLOR);
	}
	
	/**
	 * Gets the preference state machine font color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference state machine font color
	 */
	public static RGB getPreferenceStateMachineFontColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_STATEMACHINE_FONTCOLOR);
	}

	/**
	 * Gets the preference state machine font.
	 * 
	 * @param store the store
	 * 
	 * @return the preference state machine font
	 */
	public static FontData[] getPreferenceStateMachineFont(IPreferenceStore store) {
		return PreferenceConverter.getFontDataArray(store, P_STATEMACHINE_FONT);
	}
	
	/**
	 * Gets the preference state background color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference state background color
	 */
	public static RGB getPreferenceStateBackgroundColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_STATE_BACKGROUNDCOLOR);
	}
	
	/**
	 * Gets the preference state border color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference state border color
	 */
	public static RGB getPreferenceStateBorderColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_STATE_BORDERCOLOR);
	}
	
	/**
	 * Gets the preference state font color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference state font color
	 */
	public static RGB getPreferenceStateFontColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_STATE_FONTCOLOR);
	}

	/**
	 * Gets the preference state font.
	 * 
	 * @param store the store
	 * 
	 * @return the preference state font
	 */
	public static FontData[] getPreferenceStateFont(IPreferenceStore store) {
		return PreferenceConverter.getFontDataArray(store, P_STATE_FONT);
	}

	/**
	 * Sets the default preferences.
	 * 
	 * @param store the store
	 */
	public static void setDefaultPreferences(IPreferenceStore store) {
		// FinalState
		PreferenceConverter.setDefault(store, P_FINALSTATE_BACKGROUNDCOLOR, PreferenceConstants.getPapyrusColorYellow());
		PreferenceConverter.setDefault(store, P_FINALSTATE_BORDERCOLOR, PreferenceConstants.getPapyrusColorBrown());
		PreferenceConverter.setDefault(store, P_FINALSTATE_FONTCOLOR, PreferenceConstants.getPapyrusColorBlack());
		PreferenceConverter.setDefault(store, P_FINALSTATE_FONT, new FontData("Arial", 10, SWT.BOLD));

		// PseudoState
		PreferenceConverter.setDefault(store, P_PSEUDOSTATE_BACKGROUNDCOLOR, PreferenceConstants.getPapyrusColorYellow());
		PreferenceConverter.setDefault(store, P_PSEUDOSTATE_BORDERCOLOR, PreferenceConstants.getPapyrusColorBrown());
		PreferenceConverter.setDefault(store, P_PSEUDOSTATE_FONTCOLOR, PreferenceConstants.getPapyrusColorBlack());
		PreferenceConverter.setDefault(store, P_PSEUDOSTATE_FONT, new FontData("Arial", 10, SWT.BOLD));
		
		// Region
		PreferenceConverter.setDefault(store, P_REGION_BACKGROUNDCOLOR, PreferenceConstants.getPapyrusColorYellow());
		PreferenceConverter.setDefault(store, P_REGION_BORDERCOLOR, PreferenceConstants.getPapyrusColorBrown());
		PreferenceConverter.setDefault(store, P_REGION_FONTCOLOR, PreferenceConstants.getPapyrusColorBlack());
		PreferenceConverter.setDefault(store, P_REGION_FONT, new FontData("Arial", 10, SWT.BOLD));
		
		// StateMachine
		PreferenceConverter.setDefault(store, P_STATEMACHINE_BACKGROUNDCOLOR, PreferenceConstants.getPapyrusColorYellow());
		PreferenceConverter.setDefault(store, P_STATEMACHINE_BORDERCOLOR, PreferenceConstants.getPapyrusColorBrown());
		PreferenceConverter.setDefault(store, P_STATEMACHINE_FONTCOLOR, PreferenceConstants.getPapyrusColorBlack());
		PreferenceConverter.setDefault(store, P_STATEMACHINE_FONT, new FontData("Arial", 10, SWT.BOLD));
		
		// State
		PreferenceConverter.setDefault(store, P_STATE_BACKGROUNDCOLOR, PreferenceConstants.getPapyrusColorYellow());
		PreferenceConverter.setDefault(store, P_STATE_BORDERCOLOR, PreferenceConstants.getPapyrusColorBrown());
		PreferenceConverter.setDefault(store, P_STATE_FONTCOLOR, PreferenceConstants.getPapyrusColorBlack());
		PreferenceConverter.setDefault(store, P_STATE_FONT, new FontData("Arial", 10, SWT.BOLD));		
	}
}
